<?php
/*
Description: db manager; everything using the db must use this..
*/
class DbManager {
    
	public static function connect($host, $db, $username, $password){
		mysql_connect($host, $username, $password) or die(mysql_error());
		mysql_select_db($db) or die(mysql_error());
	}
	
	public static function execute($sql){
		return mysql_query($sql);
	}
	
	public static function query($sql){
	
		$resource = mysql_query($sql);
		
		$result = array();
		$index  = 0;
		while($row = mysql_fetch_array($resource))
			$result[$index++] = $row;
		
		return $result;
	}
}
?>